1. Technical Field
The present invention relates to an image decoding device operable to effectively perform error compensation when a decoding error occurs in decoding of compressed image data, and an image decoding method related thereto.
2. Background Art
MPEG 2 and MPEG 4 are used as encoding systems of moving pictures. In these days, “H.264/MPEG 4 AVC” (it's called as “H.264” hereinafter), whose compression efficiency is further improved comparing to MPEG 4, is standardized by the Joint Video Team (it's called as “JVT” hereinafter).
FIG. 13 is a block diagram of an image decoding device standardized by MPEG 4.
A variable-length decoding unit 100 decodes a variable-length encoded data stream according to a variable-length encoding table. An inverse AC/DC predicting unit 101 performs AC/DC prediction, and outputs quantized coefficients QF [x][y]. An inverse quantizing unit 102 outputs DCT coefficients F [x][y] by performing inverse quantization on the quantized coefficients QF [x][y]. An inverse DCT unit 103 performs inverse DCT on the DCT-coefficients F [x][y]. At the time of decoding a macro block (it is called as “intra macro block” hereinafter) that has been encoded by intra macro block encoding, a pixel value of a decoded image is obtained. At the time of decoding a macro block (it is called as “inter macro block” hereinafter) that has been encoded by inter macro block encoding, a difference pixel value with a previous image is obtained. A motion compensating unit 104 obtains a pixel of a data image using the difference pixel value.
FIG. 14 is a block diagram of an image decoding device standardized by H.264.
Dissimilar to an image decoding device based on MPEG 4, the image decoding device based on H.264 comprises an in-loop filter 112. The in-loop filter 112 performs de-block filtering on the pixel value after decoding at a boundary of block for an encoding unit. The de-block filtering can reduce de-block noise of a displayed image.
The de-block filtering in H.264 is explained. FIG. 15 is an illustration of a pixel that is dealt with in de-block filtering. Filtering is performed using pixels that exist both sides of the boundary of block in the figure. In the figure, each of a matrix shows a pixel, and a sign is attached to each pixel in order to distinguish.
First, whether or not the de-block filtering will be executed is judged according to Equation 1.filterSamplesFlag=(bS!=0&&Abs(p0−q0)<α&&Abs(p1−p0)<β&&Abs(q1−q0)<β)  [Equation 1]
Here, the left-hand side of Equation 1 is a flag that indicates whether the de-block filtering will be executed or not. Equation 1 is defined in H.264. A variable “bS” of the right-hand side is a parameter showing a level of smoothing in the de-block filtering, and may have some integer value from a value “0” to a value “4”.
When the variable “bS” is the value “0”, the in-loop filter 110 does not perform the de-block filtering. When the variable “bS” is one of the value “1”, the value “2”, and the value “3”, the de-block filtering is performed according to Equation 2. When the variable “bS” is the value “4”, the de-block filtering is performed according to Equation 3.p0′=Clip1(p0+)=Clip3(−tc,tc,((((q0−p0)<<2)+(p1−q1)+4)>>3))p1′=p1+Clip3(−tc0,tc0,(p2+((p0+q0)>>1)−p1<<1))>>1)  [Equation 2]p0′=(p2+2*p1+2*p0+2*q0+q1+4)>>3p1′=(p2+p1+p0+q0+2)>>2p2′=(2*p3+3*p2+p1+p0+q0+4)>>3  [Equation 3]
Each variable, such as a variable “p0” included in Equation 1, Equation 2, and Equation 3 is a pixel value of a pixel that corresponds to each variable, such as “p0” specifying a pixel in FIG. 15.
As mentioned above, the de-block filtering is performed using a pixel, which is beyond a unit area being a decoding target. In other words, using a pixel of a unit area, which is adjacent to a certain unit area, the de-block filtering of pixel to the certain unit area is performed.
Here, in H.264 (and MPEG 4), the variable-length decoding unit 100 detects a bit train that matches referring to the variable-length encoding table, and decodes a data stream.
At this time, in the data stream of the decoding target, it may not be fallen under any patterns of bit trains included in the variable-length encoding table. In this case, it is judged that a decoding error occurs. When such a decoding error occurs, all unit areas (for example, a slice) are dealt with as areas where the decoding error has occurred. Thus, when the decoding error occurs, variable-length decoding is restarted from the next unit area. The pixel value of the unit area, where the decoding error has occurred, is not used.
Here, since the pixel value of the unit area, where the decoding error has occurred, is not used, if the unused unit area is left as it is, the quality of a displayed image becomes poor.
In order to prevent making the quality of the displayed image become poor, technology, which replaces a value of a pixel included in a unit area where a decoding error has occurred to a value of pixel included in a past frame in terms of time, has been proposed (for example, Document 1). Alternatively, technology, which replaces a value of a pixel included in a unit area where a decoding error has occurred to a value of a pixel included in another area within the same frame, has been proposed (for example, Document 2).
With the conventional technology, however, only the value of the pixel, which is included in the unit area where the decoding error has occurred, is replaced to a value of another pixel. Here, since the de-block filtering is performed by the in-loop filter 110, the pixel, which is located in the boundary of the unit area where the decoding error has occurred, is used for the de-block filtering of a neighboring unit area. In other words, the pixel, in which the decoding error has occurred, is used in the de-block filtering of the neighboring unit area. For this reason, not only the unit area where the decoding error has occurred, but also the pixel of neighboring unit area, in which the de-block filtering is performed by using the pixel included in the unit area where the decoding error has occurred, becomes unstable. Therefore, the unit area, which is adjacent to the unit area where the decoding error has occurred, is influenced by the decoding error.
Although the value of the pixel, which is included in the unit area where the decoding error has occurred, can be replaced to a value of another pixel, a neighboring pixel influenced by the decoding error remains as it is. For this reason, in the conventional technology, the bad influence remains in the image quality of this neighboring pixel, and there is a problem that causes deterioration in the displayed image.
For example, as shown in FIG. 16, a pixel of a unit area, which is adjacent to a unit area where a decoding error has occurred, is influenced by the decoding error.
FIG. 16 is a diagram showing an influence caused by a decoding error in the conventional technology.
In the pixel (a circle with an X sign in the figure) included in the unit area where the decoding error has occurred, pixels surrounded by a frame is used for de-block filtering in a neighboring unit area. For this reason, also in a unit area where the decoding error does not occur, a bad influence occurs at the time of de-block filtering (a circle with a Δ sign in the figure). Even if a value of a pixel, which is included in a unit area where the decoding error has occurred, is replaced to a value of another pixel (right-hand side in the figure), pixels to which Δ signs are given remain as it is. Thus, the quality of the displayed image becomes poor.    [Document 1] Published Japanese patent application laid-open on No. H10-23424    [Document 2] Published Japanese patent application laid-open on No. H09-182068